package com.zk.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zk.entity.Evaluation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author fmy
 */
// @Mapper 后面做单元测试这里不能用mapper注解，原因未知，就是@mapper不能自动注入
@Mapper
public interface EvaluationMapper extends BaseMapper<Evaluation> {
    @Select("SELECT b.real_name,b.user_phone,a.* FROM evaluation AS a INNER JOIN user AS b ON a.evaluation_user_id = b.user_id " +
            "WHERE a.is_del = 0 AND b.is_del = 0 and evaluation_product_id= #{productId}")
    IPage<Evaluation> getEvaluationWithUserList(Page page, QueryWrapper<Evaluation> evaluationQueryWrapper,Integer productId);//wrapper
    // List<Evaluation> getEvaluationWithUserList(Integer productId);


}